mui.init();
mui.plusReady(function() {
	//	window.addEventListener('refreshdom', function(event) {
	//		console.log(event.detail.val);
	//		userindex.reqcode(event.detail.val);
	//	})
	var userindex = new Vue({
		el: "#app",
		data: {
			data: [],
			title: '',
			postid:''
		},
		mounted: function() {
			var _this = this;
			var shareInfo = plus.webview.currentWebview();
			_this.title = shareInfo.title;
			_this.postid = shareInfo.nid;
			console.log(_this.title+":"+_this.postid)
			_this.$nextTick(function() {
				_this.cartView();
			});

		},
		methods: {
			cartView: function() {
				var _this = this;
				app.postUrl(apiurl + 'Mall/goodslist.html', {
					store_id: _this.title
				}, function(res) {
					console.log(JSON.stringify(res.data))
					if(res.status === 1) {
						_this.data = res.data;
					}
				})

			},
			refresh: function(done) {
				done();
			},
			infinite: function(done) {
				done();
			},
			openwin: function(gid) {
				mui.openWindow({
					url: 'view.html',
					id: 'view',
					extras: {
						name: 'mui',
						nid: gid,
					}
				});
			},
			openurl: function(urls, uid) {
				mui.openWindow({
					url: urls,
					id: uid,
					extras: {
						name: 'mui',
					}
				});
			}

		}

	});

});